<template>
  <div>
    请输入用户名：<input type="text" v-model="username" /> 请输入密码：<input
      type="text"
      v-model="password"
    />
    <button @click="login">提交</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: '',
      password: '',
    }
  },
  methods: {
    login() {
      if (this.username == 'zhangsan' && this.password == '123456') {
        alert('登录成功！')
      } else {
        alert('登录失败')
      }
    },
  },
}
</script>

<style lang="scss" scoped>
</style>